#include<mjl.h>
//每次加载存档时，调用一次，先于map的main.c的调用
[export]
void init()
{
	//mjl_setNameInt("game_init", 1);
}
//每帧都调用,dt为每帧的时间，单位：秒
[export]
void update(float dt)
{
	/*
		char* time_60s_flag = "time_60s";
	float time_60s = mjl_getNameFloat(time_60s_flag);
	float time_60s_step = 60.0f;
	//
	time_60s += dt;
	if (time_60s> time_60s_step)
	{
		time_60s -= time_60s_step;
		mjl_msg("OK", 1.2f);
	}
	mjl_setNameFloat(time_60s_flag, time_60s);

	*/

	/*
	game_over的用法
	if ( v <= 0)
	{
		if (mjl_getNameInt("game_over") == 0)
		{
			mjl_msg("你饿死了", 1.2f);
			mjl_wait(1.2f);
			mjl_setNameInt("game_over", 1);
			mjl_setNameFloat("game_over_time", time + 1.2f);
		}
		else if (time > mjl_getNameFloat("game_over_time"))
		{
			mjl_gameOver(false);
		}
	}

	*/

}

//卸载存档时调用，即切换存档。其他情况，如游戏app关闭时，不会调用
[export]
void release()
{
	//mjl_setNameInt("game_release", 1);
}